*###########################################################*
* The Media Matters: Muslim American Portrayals and Effects *
* on Mass Attitudes                                         *
* Lajevardi                                                 *
* Journal: Journal of Politics                              *
* Stata Replication Code                                    *
* Tested on Stata 15.1                                      *
* Note: please install "coefplot" and "grc1leg" before      *
* running code                                              *
*###########################################################*

clear all
clear matrix
set more off, perm
cd "/Users/nazita/Dropbox/Media Matters/Media Matters Paper/Replication files/" /*set your own working directory*/
log using "Media Matters Log.text", replace text 


*****************************************************************************
************** I N  T E X T  T A B L E S  A N D  F I G U R E S ************** 
*****************************************************************************




******************
**** FIGURE 1 ****
******************

** (A) Yearly mean standardized sentiment score **
			
		**************
		** CNN data **
		**************

		clear
		insheet using "sentiment frames 7-19_CNN_abbreviated.csv", clear
		tsset year, yearly
		graph twoway line black latino asianam muslim muslimam total year, ///
			xline(2001) graphregion(color(white)) ///
			yscale(range(-1 3.5)) ///
			title("Yearly Mean Media Coverage Sentiment (CNN, 1992-2016)", span size(medium)) ///
			ytitle("Standardized Sentiment Score", size(small)) ///
			xtitle("Year", size(small)) ///
			xscale(range(1990 2017)) ///
			legend(label (1 "Black") label (2 "Latino") label (3 "Asian American") ///
			label (4 "Muslim")  label (5 "Muslim American") label (6 "All Broadcasts") ///
			rows(2) ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.85)

		graph save Graph "figure1_a.gph", replace

			

** (B) Proportion of Yearly Coverage **
			
		**************
		** CNN data **
		**************
			
		clear 
		insheet using "frequency_proportion_CNN.csv", clear
		tsset Year, yearly
		graph twoway line prop_black prop_asianam prop_latino prop_muslim prop_mam Year, ///
			xline(2001) graphregion(color(white)) ///
			ytitle("Proportion of Coverage by Year", size(small)) ///
			title("Proportion of Total Yearly Coverage (CNN, 1992-2016)", span size(medium)) ///
			yscale(range(0 0.7)) ///
			xscale(range(2000 2016)) ///
			xtitle("Year", size(small)) ///
			legend(label (1 "Black") label (2 "Asian American") label (3 "Latino")	///
			label (4 "Muslim") label (5 "Muslim American") rows(2) ///
			ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.85)
		graph save Graph "figure1_b.gph", replace
			

			
		
******************
**** FIGURE 2 ****
******************

** CNN Coef Plot

	clear 
	use  "appended_race_groups_sent_broadcasts.dta",clear
	keep if CNN == 1

		label var black "Black"
		label var latino "Latino"
		label var asianam "Asian American"
		label var muslim "Muslim"

	eststo clear
	quietly eststo Full: areg z_sentiment1 muslim black asianam latino, absorb(date)
		estimates store Full
	quietly eststo Pre911: areg z_sentiment1 muslim black asianam latino if pre911 ==1, absorb(date)
		estimates store Pre911
	quietly eststo Post911: areg z_sentiment1 muslim black asianam latino if pre911 ==0, absorb(date)
		estimates store Post911

	coefplot (Full \ Pre911 \ Post911 ), xline(0) drop(_cons) aseq  ///
		coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim = "Muslim") ///
		title("Coefficient Plot (CNN, Hu and Liu) ", span size(medium)) ///
		ytitle("", size(small)) graphregion(color(white)) ///
		xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
		xtitle("Standardized sentiment coefficient", size(small)) scale(0.65)
		
	graph save Graph "figure2.gph", replace
	



******************
**** FIGURE 3 ****
******************

		***********************
		** FOX data sentiment**
		***********************

			
		clear 
		insheet using "sentiment frames 7-19_FOX_abbreviated.csv", clear
		preserve
		drop if year <2001
		tsset year, yearly
		graph twoway line black latino asianam muslim muslimam total year, ///
			xline(2001)  graphregion(color(white)) ///
			yscale(range(-1 3.5)) ///
			xscale(range(2000 2017)) ///
			title("Yearly Mean Media Coverage Sentiment (FOX, 2001-2016)", span size(small)) ///
			ytitle("Standardized Sentiment Score", size(small)) ///
			xtitle("Year", size(small)) ///
			legend(label (1 "Black") label (2 "Latino") label (3 "Asian American") ///
			label (4 "Muslim")  label (5 "Muslim American") label (6 "All Broadcasts") ///
			rows(2) ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.85)
		graph save Graph "figure3_a.gph", replace
		restore


		*************************
		** MSNBC data sentiment**
		*************************


		clear 
		insheet using "sentiment frames 7-19_MSNBC_abbreviated.csv", clear
		preserve
		drop if year <2001
		tsset year, yearly
		graph twoway line black latino asianam muslim muslimam total year, ///
			xline(2001) graphregion(color(white)) ///
			yscale(range(-1 3.5)) ///
			title("Yearly Mean Media Coverage Sentiment (MSNBC, 2001-2016)", span size(small)) ///
			ytitle("Standardized Sentiment Score", size(small)) ///
			xscale(range(1998 2017)) ///
			xtitle("Year", size(small)) ///
			legend(label (1 "Black") label (2 "Latino") label (3 "Asian American") ///
			label (4 "Muslim")  label (5 "Muslim American") label (6 "All Broadcasts") ///
			rows(2) ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.85) 
		graph save Graph "figure3_b.gph", replace
		restore


	grc1leg figure3_a.gph figure3_b.gph, col(2)  ysize(5) xsize(20) ///
	graphregion(color(white))  scheme(s2mono)

	graph save Graph "figure3_combined.gph", replace
		
		

******************
**** FIGURE 4 ****
******************
		
		************************
		** FOX data proportion**
		************************
		
				
		clear 
		insheet using "frequency_proportion_FOX.csv", clear
		tsset Year, yearly
		preserve
		drop if Year <2001
		graph twoway line prop_black prop_asianam  prop_latino prop_muslim prop_mam Year, ///
			xline(2001) graphregion(color(white)) ///
			title("Proportion of Total Yearly Coverage (FOX)", span size(small)) ///
			ytitle("Proportion of Coverage by Year", size(small)) ///
			yscale(range(0 0.7)) ///
			xscale(range(2000 2016)) ///
			xtitle("Year", size(small)) ///
			legend(label (1 "Black") label (2 "Asian American") label (3 "Latino")	///
			label (4 "Muslim") label (5 "Muslim American") rows(2) ///
			ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.85)
		graph save Graph "figure4_a.gph", replace		
		restore
	
		**************************
		** MSNBC data proportion**
		**************************

				
		clear 
		insheet using "frequency_proportion_MSNBC.csv", clear
		preserve
		drop if Year <2001
		tsset Year, yearly
		graph twoway line prop_black prop_asianam prop_latino prop_muslim prop_mam Year, ///
			xline(2001) graphregion(color(white)) ///
			title("Proportion of Total Yearly Coverage (MSNBC)", span size(small)) ///
			ytitle("Proportion of Coverage by Year", size(small)) ///
			yscale(range(0 0.7)) ///
			xscale(range(2000 2016)) ///
			xtitle("Year", size(small)) ///
			legend(label (1 "Black") label (2 "Asian American") label (3 "Latino")	///
			label (4 "Muslim") label (5 "Muslim American") rows(2) ///
			ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.85)
		graph save Graph "figure4_b.gph", replace
		restore
		
	grc1leg	figure4_a.gph figure4_b.gph, col(2)  ysize(5) xsize(10) ///
	graphregion(color(white))  scheme(s2mono)

	graph save Graph "figure4_combined.gph", replace

		
******************
**** FIGURE 5 ****
******************


	clear 
	use "appended_race_groups_sent_broadcasts.dta",clear
	eststo clear 

	gen group = .
	replace group = 1 if muslim ==1
	replace group = 2 if muslimam ==1
	replace group = 3 if black ==1
	replace group = 4 if latino ==1
	replace group = 5 if asianam ==1

	tab group

	graph bar (mean) z_sentiment1 if pre911==0, over(group, relabel(1 "Muslim" ///
	2 "Muslim American" 3 "Black" 4 "Latino" 5 "Asian American")label(angle(45))) ///
	 over(pub) plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	 ytitle("Mean Standardized Sentiment Score (Hu and Liu)") ///
	 b1title("Broadcast Coverage from 9/11-2016") yscale(range(-1 1) titlegap(1)) scale(0.65)
	graph save Graph "figure5.gph", replace





******************
**** FIGURE 6 ****
******************

** Coef plot FOX & MSNBC **

	*FOX: Hu and Liu
		clear 
		use  "appended_race_groups_sent_broadcasts.dta",clear
		keep if FOX == 1

			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim "Muslim"

		eststo clear
		quietly eststo Post911: areg z_sentiment1 muslim black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911
		 
		coefplot ( Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim = "Muslim") ///
			title("Coefficient Plot (FOX, Hu and Liu) ", span size(small)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 
			
		graph save Graph "figure6_a.gph", replace


	*MSNBC: Hu and liu
		clear 
		use  "appended_race_groups_sent_broadcasts.dta",clear
		keep if MSNBC	 == 1

			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim "Muslim"

		eststo clear
		quietly eststo Post911: areg z_sentiment1 muslim black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911

		coefplot (Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim = "Muslim") ///
			title("Coefficient Plot (MSNBC, Hu and Liu) ", span size(small)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 

		graph save Graph "figure6_b.gph", replace

		
	graph combine figure6_a.gph figure6_b.gph, col(2) ///
	 ysize(8) xsize(20) graphregion(color(white)) scale(0.85)

	graph save Graph "figure6_combined.gph", replace
		

	
	

*******************
***** TABLE 1 *****
*******************

	*Exp 1
	use "exp1_exp2.dta", clear
	ttest Premrr == Postmrr if group == 5  /*Positive MAM (Real)*/
	ttest Premrr == Postmrr if group == 6  /*Positive Muslim (Real)*/
	ttest Premrr == Postmrr if group == 5|group == 6  /*agg*/	
	
	
	*Exp2
	use "exp1_exp2.dta", clear
	ttest Premrr == Postmrr if group == 1  /*Positive MAM (Man)*/
	ttest Premrr == Postmrr if group == 2  /*Positive Musl (Man)*/	
	ttest Premrr == Postmrr if group == 1| group == 2  /*agg*/	
	
	*Exp3
	use "exp3.dta", clear
	ttest Premrr == Postmrr if fl_32_do == "T1-posMAM"
	ttest Premrr == Postmrr if fl_32_do == "T1a-posMAM2"
	ttest Premrr == Postmrr if fl_32_do == "T3-posMuslim"	
	keep if muslimexperiment ==1
	drop if fl_32_do == "T9-control"
	ttest Premrr == Postmrr if negativetreatment ==0
	drop if fl_32_do == "T1a-posMAM2" 
	ttest Premrr == Postmrr if negativetreatment ==0


	*Exp 1
	use "exp1_exp2.dta", clear
	ttest Premrr == Postmrr if group == 7  /*Negative MAM (Real) */
	ttest Premrr == Postmrr if group == 8  /*Negative Musl (Real)*/	
	ttest Premrr == Postmrr if group == 7|group == 8  /*agg*/	
	
	*Exp2
	use "exp1_exp2.dta", clear
	ttest Premrr == Postmrr if group == 3  /*Negative MAM (Man)*/
	ttest Premrr == Postmrr if group == 4  /*Negative Musl (Man)*/	
	ttest Premrr == Postmrr if group == 3|  group == 4  /*agg*/	
	
	*Exp3
	use "exp3.dta", clear
	ttest Premrr == Postmrr if fl_32_do == "T2-negMAM"
	ttest Premrr == Postmrr if fl_32_do == "T4-negMuslim"	
	keep if muslimexperiment ==1
	drop if fl_32_do == "T9-control"
	ttest Premrr == Postmrr if negativetreatment ==1
	drop if fl_32_do == "T1a-posMAM2" 
	ttest Premrr == Postmrr if negativetreatment ==1


	
*******************
***** TABLE 2 *****
*******************

	
	*Exp2
	use "exp1_exp2.dta", clear
	ttest Postmrr if group == 1 | group ==3, by (group)  /*Positive versus Negative MAM (Man)*/
	ttest Postmrr if group == 2 | group ==4, by (group) /*Positive versus Negative Muslim (Man)*/
	ttest Postmrr if group == 1| group == 2| group == 3| group ==4, by(positive)
	
	*Exp3
	use "exp3.dta", clear
	keep if muslimexperiment ==1
	drop if fl_32_do == "T9-control"
	ttest Postmrr if fl_32_do == "T1-posMAM" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive versus Negative MAM (Man)*/
	ttest Postmrr if fl_32_do == "T1a-posMAM2" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/
	ttest Postmrr if fl_32_do == "T3-posMuslim" | fl_32_do == "T4-negMuslim", by(fl_32_do) /*Pos versus Neg (Muslim) */
	ttest Postmrr, by(negativetreatment) /*Pos versus Neg (incl alt)*/
	drop if fl_32_do == "T1a-posMAM2"
	ttest Postmrr, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
	
	*Exp4
	use "exp4.dta", clear
	keep if muslimexperiment ==1
	drop if fl_21_do == "T9-control"
	ttest Postmrr if fl_21_do == "T1-MAMpos-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive versus Negative MAM (Man)*/
	ttest Postmrr if fl_21_do == "T2-MAMposalt-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/
	ttest Postmrr if fl_21_do == "T4-Muslimpos-Nazita" | fl_21_do == "T5-Muslimneg-Nazita", by(fl_21_do) /*Pos versus Neg (Muslim) */
	ttest Postmrr, by(negativetreatment) /*Pos versus Neg (incl alt)*/
	drop if fl_21_do == "T2-MAMposalt-Nazita"
	ttest Postmrr, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
		
	

	
*******************
***** TABLE 3 *****
*******************


	*Exp2
	use "exp1_exp2.dta", clear
	ttest PP_limitallimm if group == 1 | group ==3, by (group)  /*Positive versus Negative MAM (Man)*/
	ttest PP_limitMuslimm if group == 1 | group ==3, by (group)  /*Positive versus Negative MAM (Man)*/
	ttest PP_limitMAMreenter if group == 1 | group ==3, by (group)  /*Positive versus Negative MAM (Man)*/

	ttest PP_limitallimm if group == 2 | group ==4, by (group) /*Positive versus Negative Muslim (Man)*/
	ttest PP_limitMuslimm if group == 2 | group ==4, by (group) /*Positive versus Negative Muslim (Man)*/
	ttest PP_limitMAMreenter if group == 2 | group ==4, by (group) /*Positive versus Negative Muslim (Man)*/

	ttest PP_limitallimm if group == 1| group == 2| group == 3| group ==4, by(positive)
	ttest PP_limitMuslimm if group == 1| group == 2| group == 3| group ==4, by(positive)
	ttest PP_limitMAMreenter if group == 1| group == 2| group == 3| group ==4, by(positive)
	
	*Exp3
	use "exp3.dta", clear
	keep if muslimexperiment ==1
	drop if fl_32_do == "T9-control"
	
	ttest PP_limitallimm if fl_32_do == "T1-posMAM" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive versus Negative MAM (Man)*/
	ttest PP_limitMuslimm if fl_32_do == "T1-posMAM" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive versus Negative MAM (Man)*/
	ttest PP_limitMAMreenter if fl_32_do == "T1-posMAM" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive versus Negative MAM (Man)*/

	ttest PP_limitallimm if fl_32_do == "T1a-posMAM2" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/
	ttest PP_limitMuslimm if fl_32_do == "T1a-posMAM2" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/
	ttest PP_limitMAMreenter if fl_32_do == "T1a-posMAM2" | fl_32_do == "T2-negMAM", by(fl_32_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/

	ttest PP_limitallimm if fl_32_do == "T3-posMuslim" | fl_32_do == "T4-negMuslim", by(fl_32_do) /*Pos versus Neg (Muslim) */
	ttest PP_limitMuslimm if fl_32_do == "T3-posMuslim" | fl_32_do == "T4-negMuslim", by(fl_32_do) /*Pos versus Neg (Muslim) */
	ttest PP_limitMAMreenter if fl_32_do == "T3-posMuslim" | fl_32_do == "T4-negMuslim", by(fl_32_do) /*Pos versus Neg (Muslim) */

	ttest PP_limitallimm, by(negativetreatment) /*Pos versus Neg (incl alt)*/
	ttest PP_limitMuslimm, by(negativetreatment) /*Pos versus Neg (incl alt)*/
	ttest PP_limitMAMreenter, by(negativetreatment) /*Pos versus Neg (incl alt)*/

	drop if fl_32_do == "T1a-posMAM2"

	ttest PP_limitallimm, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
	ttest PP_limitMuslimm, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
	ttest PP_limitMAMreenter, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
	
	
	*Exp4
	use "exp4.dta", clear
	keep if muslimexperiment ==1
	drop if fl_21_do == "T9-control"
	
	ttest PP_limitallimm if fl_21_do == "T1-MAMpos-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive versus Negative MAM (Man)*/
	ttest PP_limitMuslimm if fl_21_do == "T1-MAMpos-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive versus Negative MAM (Man)*/
	ttest PP_limitMAMreenter if fl_21_do == "T1-MAMpos-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive versus Negative MAM (Man)*/

	ttest PP_limitallimm if fl_21_do == "T2-MAMposalt-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/
	ttest PP_limitMuslimm if fl_21_do == "T2-MAMposalt-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/
	ttest PP_limitMAMreenter if fl_21_do == "T2-MAMposalt-Nazita" | fl_21_do == "T3-MAMneg-Nazita", by(fl_21_do)  /*Positive (alt MAM) versus Negative MAM (Man)*/

	ttest PP_limitallimm if fl_21_do == "T4-Muslimpos-Nazita" | fl_21_do == "T5-Muslimneg-Nazita", by(fl_21_do) /*Pos versus Neg (Muslim) */
	ttest PP_limitMuslimm if fl_21_do == "T4-Muslimpos-Nazita" | fl_21_do == "T5-Muslimneg-Nazita", by(fl_21_do) /*Pos versus Neg (Muslim) */
	ttest PP_limitMAMreenter if fl_21_do == "T4-Muslimpos-Nazita" | fl_21_do == "T5-Muslimneg-Nazita", by(fl_21_do) /*Pos versus Neg (Muslim) */

	ttest PP_limitallimm, by(negativetreatment) /*Pos versus Neg (incl alt)*/
	ttest PP_limitMuslimm, by(negativetreatment) /*Pos versus Neg (incl alt)*/
	ttest PP_limitMAMreenter, by(negativetreatment) /*Pos versus Neg (incl alt)*/

	drop if fl_21_do == "T2-MAMposalt-Nazita"
	
	ttest PP_limitallimm, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
	ttest PP_limitMuslimm, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
	ttest PP_limitMAMreenter, by(negativetreatment) /*Pos versus Neg (not incl alt)*/
		
	
	

	
	
*******************************************************************************************************************



******************************************************************************
************* A P P E N D I X  T A B L E S  A N D  F I G U R E S ************* 
******************************************************************************

*******************
***** TABLE A1 ****
*******************
	use "full_muslimrace_FC_3_2020.dta", clear
	tab year if hasmuslim_FC =="TRUE"
	tab year if hasmuslimam_FC == "TRUE"
	tab year if hasarabam == "TRUE"
	tab year if hasmideast == "TRUE"
	tab year if hasnator == "TRUE"


********************
***** FIGURE A1 ****
********************

	insheet using "frequency table muslim groups.csv", clear

	tsset year, yearly
	graph twoway line muslimam arabam mideast nator year, ///
		xline(2001) graphregion(color(white)) ///
		title("Volume of coverage for alternative domestic Muslim groups", span size(medium)) ///
		ytitle("Number of mentions by year", size(small)) ///
		yscale(range(0 0.7)) ///
		xscale(range(1997 2016)) ///
		xtitle("Year", size(small)) ///
		legend( label (1 "Muslim American") label (2 "Arab American") label (3 "Middle Easterner") label (4 "National Origin")rows(2) ring(0) pos(-2) size(vsmall) region(lcolor(white))) scale(0.65)

	graph save Graph "figureA1.gph", replace 

	

	
******************
**** TABLE B1 ****	
******************

	use "appended_race_groups_sent_broadcasts.dta", clear

	 estpost corr z_sentiment1 z_sentiment2 if black ==1, matrix
	 esttab . using myfile.tex, not unstack compress noobs replace booktabs page
	!texify -p -c -b --run-viewer corr.tex

	 estpost corr z_sentiment1 z_sentiment2 if latino ==1, matrix
	 esttab . using myfile.tex, not unstack compress noobs replace booktabs page
	!texify -p -c -b --run-viewer corr.tex

	 estpost corr z_sentiment1 z_sentiment2 if asianam ==1, matrix
	 esttab . using myfile.tex, not unstack compress noobs replace booktabs page
	!texify -p -c -b --run-viewer corr.tex

	 estpost corr z_sentiment1 z_sentiment2 if muslim ==1, matrix
	 esttab . using myfile.tex, not unstack compress noobs replace booktabs page
	!texify -p -c -b --run-viewer corr.tex

	 estpost corr z_sentiment1 z_sentiment2 if muslimam ==1, matrix
	 esttab . using myfile.tex, not unstack compress noobs replace booktabs page
	!texify -p -c -b --run-viewer corr.tex


******************
**** TABLE B2 ****	
******************
	
* See R script for hand correlation*
	
	
	
******************
**** TABLE C2 ****	
******************

	use "appended_race_groups_sent_broadcasts.dta", clear
	tab year if asian ==1
	
	insheet using "Complete_Group_Alt_Asian.csv", clear
	tab year
		
	
******************
**** TABLE C3 ****	
******************
	use "Alt_Black.dta", clear
	replace year = "." if year =="NA"
	destring year, replace

	foreach var of varlist newscore_sept28{
	egen z_`var'= std(`var')
	}
	tab year, sum(z_newscore_sept28)

	use "appended_race_groups_sent_broadcasts.dta",clear
	drop if length>30000
	tab year if black==1, sum(z_sentiment1) 	
		
	use "Alt_Latino.dta", clear
	foreach var of varlist newscore_sept28{
	egen z_`var'= std(`var')
	}
	tab year, sum(z_newscore_sept28)

	use "appended_race_groups_sent_broadcasts.dta",clear
	drop if length>30000
	tab year if latino==1, sum(z_sentiment1) 

	
	
*********************
***** TABLES D1 *****
*********************

	use "full_muslimrace_FC_3_2020.dta", clear
	
	tab year if hasmuslim_FC =="TRUE"
	tab year if hasmuslimam_FC == "TRUE"
	

************************
***** TABLES D2-D11 ****
************************

* Topic models generated in R *
* See R script *


***********************
***** Appendix E ****
***********************

		**********************************************************
		** Desriptives on standardized sentiment score by group **
		**********************************************************

		use "merged_full_broadcasts.dta", clear

		tab pub
		di 459098 + 272008/*Total number of transcript from CNN: 731106*/
		tab year if pub == "CNN" /*Total number of transcripts from CNN: 459,098 */
		sum length if pub == "CNN", detail /*Average length was: 2658.55 words*/
		tab year if pub == "FOX" /*Total number of transcripts from FOX: 104,114*/
		tab year if pub == "MSNBC" /*Total number of transcripts from MSNBC: 24,749*/
		
		drop if length >30000 /*Now looking among those observations that are 30000 words or less*/
		drop if pub == "MSNBC.com"
		drop if pub == "CNN.com"
		
		tab pub
		tab year if pub == "CNN" /*Total number of transcripts from CNN:  459,036*/
		tab year if pub == "FOX" /*Total number of transcripts from FOX: 104,110*/
		tab year if pub == "MSNBC" /*Total number of transcripts from MSNBC: 24,734*/
		
		drop if year <2001 & pub == "FOX"
		drop if year <2001 & pub == "MSNBC"
		
		tab year if pub == "CNN", sum(z_sentiment1)
		tab year if pub == "FOX", sum(z_sentiment1)
		tab year if pub == "MSNBC", sum(z_sentiment1)

		use "appended_race_groups_sent_broadcasts.dta", clear /*Note: this dataset has limited broadcasts to 30,000 words = ~180 min*/
		drop if year <2001 & pub == "FOX"
		drop if year <2001 & pub == "MSNBC"
		
		
	*********************
	*** Table E1: CNN ***
	*********************
	
		use "appended_race_groups_sent_broadcasts.dta", clear /*Note: this dataset has limited broadcasts to 30,000 words = ~180 min*/

		preserve
		keep if muslim ==1
		tab year if pub == "CNN",sum(z_sentiment1)
		restore

		preserve
		keep if muslimam ==1
		tab year if pub == "CNN",sum(z_sentiment1)
		restore

		preserve
		keep if black ==1
		tab year if pub == "CNN",sum(z_sentiment1)
		restore

		preserve
		keep if latino ==1
		tab year if pub == "CNN",sum(z_sentiment1)
		restore

		preserve
		keep if asianam ==1
		tab year if pub == "CNN",sum(z_sentiment1)
		restore
		
		
	*********************
	*** Table E2: FOX ***
	*********************
		
		use "appended_race_groups_sent_broadcasts.dta", clear /*Note: this dataset has limited broadcasts to 30,000 words = ~180 min*/
		drop if year <2001 & pub == "FOX"

		preserve
		keep if muslim ==1
		tab year if pub == "FOX",sum(z_sentiment1)
		restore

		preserve
		keep if muslimam ==1
		tab year if pub == "FOX",sum(z_sentiment1)
		restore

		preserve
		keep if black ==1
		tab year if pub == "FOX",sum(z_sentiment1)
		restore

		preserve
		keep if latino ==1
		tab year if pub == "FOX",sum(z_sentiment1)
		restore

		preserve
		keep if asianam ==1
		tab year if pub == "FOX",sum(z_sentiment1)
		restore

		
	*********************
	*** Table E3: MSNBC ***
	*********************
	
		use "appended_race_groups_sent_broadcasts.dta", clear /*Note: this dataset has limited broadcasts to 30,000 words = ~180 min*/
		drop if year <2001 & pub == "MSNBC"
		
		preserve
		keep if muslim ==1
		tab year if pub == "MSNBC",sum(z_sentiment1)
		restore

		preserve
		keep if muslimam ==1
		tab year if pub == "MSNBC",sum(z_sentiment1)
		restore

		preserve
		keep if black ==1
		tab year if pub == "MSNBC",sum(z_sentiment1)
		restore

		preserve
		keep if latino ==1
		tab year if pub == "MSNBC",sum(z_sentiment1)
		restore

		preserve
		keep if asianam ==1
		tab year if pub == "MSNBC",sum(z_sentiment1)
		restore

		
	

*******************
***** TABLE F1 ****
*******************

	use "appended_race_groups_sent_broadcasts.dta", replace

	preserve
	keep if CNN ==1
	eststo clear
	eststo: quietly areg z_sentiment1 black latino muslim asianam if pre911 ==1, absorb(date)
	eststo: quietly areg z_sentiment2 black latino muslim asianam if pre911 ==1, absorb(date)
	eststo: quietly areg z_sentiment1 black latino muslim asianam if pre911 ==0, absorb(date)
	eststo: quietly areg z_sentiment2 black latino muslim asianam if pre911 ==0, absorb(date)
	eststo: quietly areg z_sentiment1 black latino muslim asianam, absorb(date)
	eststo: quietly areg z_sentiment2 black latino muslim asianam, absorb(date)

	esttab, se r2
	esttab using tableF1.tex, se r2 replace		
	restore


*******************
***** TABLE F2 ****
*******************

	use "appended_race_groups_sent_broadcasts.dta", replace
	preserve
	keep if pre911 ==0 & FOX ==1
	eststo clear 
	eststo: quietly areg z_sentiment1 black latino muslim asianam, absorb(date)
	eststo: quietly areg z_sentiment2 black latino muslim asianam, absorb(date)

	esttab, se r2
	esttab using tableF2.tex, se r2 replace		
	restore
	
	

*******************
***** TABLE F3 ****
*******************

	use "appended_race_groups_sent_broadcasts.dta", replace
	preserve
	keep if pre911 ==0 & MSNBC == 1
	eststo clear /*Don't do any pre-911 analyses with MSNBC -- also super underpowerd bc only have 1 MAM obvs*/
	eststo: quietly areg z_sentiment1 black latino muslim asianam, absorb(date)
	eststo: quietly areg z_sentiment2 black latino muslim asianam, absorb(date)

	esttab, se r2
	esttab using tableF3.tex, se r2 replace		
	restore



*******************
***** TABLE F4 ****
*******************

	insheet using  "appended_race_groups_sent_broadcasts_Muslim_noMAM.csv",clear
		eststo clear
		eststo: quietly areg z_sentiment1  muslim_notmam black asianam latino if cnn==1, absorb(date)
		eststo: quietly areg z_sentiment1  muslim_notmam black asianam latino if cnn==1 & pre911 ==1, absorb(date)
		eststo: quietly areg z_sentiment1  muslim_notmam black asianam latino if cnn==1 & pre911 ==0, absorb(date)
		eststo: quietly areg z_sentiment1  muslim_notmam black asianam latino if fox==1 & pre911 ==0, absorb(date)
		eststo: quietly areg z_sentiment1  muslim_notmam black asianam latino if msnbc==1 & pre911 ==0, absorb(date)
		esttab, se r2
	esttab using tableF4.tex, se r2 replace		



*******************
**** FIGURE F1 ****
*******************

*MuslimnoMAM robustness	

	*******************
	** Cnn: HU & Liu **
	*******************

		insheet using  "appended_race_groups_sent_broadcasts_Muslim_noMAM.csv",clear
			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim_notmam "Muslim (no MAM)"

		eststo clear
		quietly eststo Full: areg z_sentiment1 muslim_notmam black asianam latino, absorb(date)
			estimates store Full
		quietly eststo Pre911: areg z_sentiment1 muslim_notmam black asianam latino if pre911 ==1, absorb(date)
			estimates store Pre911
		quietly eststo Post911: areg z_sentiment1 muslim_notmam black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911

		coefplot (Full \ Pre911 \ Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim_notmam = "Muslim (no MAM)") ///
			title("Coefficient Plot (CNN, Hu and Liu) ", span size(medium)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) scale(0.85)

		graph save Graph "figureF1.gph", replace


*******************
**** FIGURE F2 ****
*******************

	*******************
	** Fox: HU & Liu **
	*******************

		insheet using  "appended_race_groups_sent_broadcasts_Muslim_noMAM.csv",clear
		
			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim_notmam "Muslim (no MAM)"

		eststo clear
		quietly eststo Post911: areg z_sentiment1 muslim_notmam black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911

		coefplot (Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" ///
			muslim_notmam = "Muslim (no MAM)") ///
			title("Coefficient Plot (FOX, Hu and Liu, post 9/11) ", span size(medium)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 
		
		graph save Graph "figureF2_a.gph", replace



	*********************
	** MSNBC: HU & Liu **
	*********************

		insheet using  "appended_race_groups_sent_broadcasts_Muslim_noMAM.csv",clear
		
			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim_notmam "Muslim (no MAM)"

		eststo clear
		quietly eststo Post911: areg z_sentiment1 muslim_notmam black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911

		coefplot (Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" ///
			muslim_notmam = "Muslim (no MAM)") ///
			title("Coefficient Plot (MSNBC, Hu and Liu, post 9/11)", span size(medium)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 
	
		graph save Graph "figureF2_b.gph", replace

	
	graph combine figureF2_a.gph figureF2_b.gph, col(2)  ysize(10) xsize(20) ///
	graphregion(color(white)) scale(0.85)
	graph save Graph "figureF2_combined.gph", replace	



*******************
**** FIGURE F3 ****
*******************


	****************
	** Cnn: Afinn **
	****************

		use  "appended_race_groups_sent_broadcasts.dta",clear
		keep if CNN == 1

			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim "Muslim"

		eststo clear
		quietly eststo Full: areg z_sentiment2 muslim black asianam latino, absorb(date)
			estimates store Full
		quietly eststo Pre911: areg z_sentiment2 muslim black asianam latino if pre911 ==1, absorb(date)
			estimates store Pre911
		quietly eststo Post911: areg z_sentiment2 muslim black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911
		 
		coefplot (Full \ Pre911 \ Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim = "Muslim") ///
			title("Coefficient Plot (CNN, Afinn) ", span size(medium)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 

		graph save Graph "figureF3_a.gph", replace

		
		
	****************
	** Fox: Afinn **
	****************
	
		use  "appended_race_groups_sent_broadcasts.dta",clear
		keep if FOX == 1

			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim "Muslim"

		eststo clear
		quietly eststo Post911: areg z_sentiment2 muslim black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911

		coefplot (Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim = "Muslim") ///
			title("Coefficient Plot (FOX, Afinn, Post-9/11) ", span size(medium)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 
		
		graph save Graph "figureF3_b.gph", replace

		
		
	******************	
	** MSNBC: Afinn **
	******************
		
		use  "appended_race_groups_sent_broadcasts.dta",clear
		keep if MSNBC	 == 1

			label var black "Black"
			label var latino "Latino"
			label var asianam "Asian American"
			label var muslim "Muslim"

		eststo clear
		quietly eststo Post911: areg z_sentiment2 muslim black asianam latino if pre911 ==0, absorb(date)
			estimates store Post911
		 
		coefplot (Post911 ), xline(0) drop(_cons) aseq  ///
			coeflabels(black= "Black" latino= "Latino" asianam = "Asian American" muslim = "Muslim") ///
			title("Coefficient Plot (MSNBC, Afinn, Post-9/11) ", span size(medium)) ///
			ytitle("", size(small)) graphregion(color(white)) ///
			xscale(range(-0.3 0.3)) xtick( -0.2(0.1)0.3 ) xlabel( -0.2(0.1)0.3 )  ///
			xtitle("Standardized sentiment coefficient", size(small)) 

		graph save Graph "figureF3_c.gph", replace


	graph combine figureF3_a.gph figureF3_b.gph figureF3_c.gph, col(2) ysize(16) ///
	xsize(20) graphregion(color(white)) scale(0.65)
	graph save Graph "figureF3_combined.gph", replace	




*******************
**** FIGURE F4 ****
*******************

	use "appended_race_groups_sent_broadcasts.dta",clear
	eststo clear 

	gen group = .
	replace group = 1 if muslim ==1
	replace group = 2 if muslimam ==1
	replace group = 3 if black ==1
	replace group = 4 if latino ==1
	replace group = 5 if asianam ==1

	tab group

	graph bar (mean) z_sentiment2 if pre911==0, over(group, relabel(1 "Muslim" 2 ///
	"Muslim American" 3 "Black" 4 "Latino" 5 "Asian American")label(angle(45))) ///
	over(pub) plotregion(fcolor(white)) graphregion(fcolor(white)) ///
	ytitle("Mean Standardized Sentiment Score (Afinn)") ///
	b1title("Broadcast Coverage from 9/11-2016") yscale(range(-1 1) ///
	titlegap(1)) scale(0.65)

	graph save Graph "figureF4.gph", replace







******************
**** TABLE G1 ****
******************

	use "exp1_exp2.dta", clear
	drop if Postmrr ==.
	*Real experiment
	tab group if group ==5 /*Positive MAM (Real)*/
	tab group if group ==6 /*Positive Muslim (Real)*/
	tab group if group ==7 /*Negative MAM (Real) */
	tab group if group ==8 /*Negative Musl (Real)*/	

	
******************
**** TABLE G2 ****
******************

	use "exp1_exp2.dta", clear	
	*Manipulated experiment
	tab group if group ==1 /*Positive MAM (Man)*/
	tab group if group ==2 /*Positive Muslim (Man)*/
	tab group if group ==3 /*Negative MAM (Man)*/
	tab group if group ==4 /*Negative Musl (Man)*/	
	
	
******************
**** TABLE G3 ****
******************
	
	use "exp1_exp2.dta", clear
	
	drop if group ==1| group ==2| group ==3| group ==4
			
		*Positive MAM (Real) == GROUP == 5
		
			sum age if group ==5
			sum female if group ==5
			sum dem if group ==5
			sum rep if group ==5
			sum independent if group ==5
			sum educ if group ==5
			sum income if group ==5
			sum Premrr if group ==5
			sum Postmrr if group ==5

		*Positive Muslim (Real) == GROUP == 6
			
			sum age if group ==6
			sum female if group ==6
			sum dem if group ==6
			sum rep if group ==6
			sum independent if group ==6
			sum educ if group ==6
			sum income if group ==6
			sum Premrr if group ==6
			sum Postmrr if group ==6
			

		*Negative MAM (Real)  == GROUP == 7 *** 
			
			sum age if group ==7
			sum female if group ==7
			sum dem if group ==7
			sum rep if group ==7
			sum independent if group ==7
			sum educ if group ==7
			sum income if group ==7
			sum Premrr if group ==7	
			sum Postmrr if group ==7
			
		*Negative Musl (Real) == GROUP == 8 *** 
			
			sum age if group ==8
			sum female if group ==8
			sum dem if group ==8
			sum rep if group ==8
			sum independent if group ==8
			sum educ if group ==8
			sum income if group ==8
			sum Premrr if group ==8
			sum Postmrr if group ==8
			
	
******************
**** TABLE G4 ****
******************

	use "exp1_exp2.dta", clear
	
	drop if group ==1| group ==2| group ==3| group ==4
	
	ttest Postmrr if group ==5 | group ==7, by (group) /*Positive MAM (Real) or Negative MAM (Real)*/
	ttest Postmrr if group ==6 | group ==8, by (group) /*Positive Muslim (Real) or Negative Musl (Real)*/
	ttest Postmrr, by (positive)
	

******************
**** TABLE G5 ****
******************

	use "exp1_exp2.dta", clear
	
	drop if group ==1| group ==2| group ==3| group ==4
	
	ttest PP_limitallimm if group ==5 | group ==7, by (group) /*Positive MAM (Real) or Negative MAM (Real)*/
	ttest PP_limitallimm if group ==6 | group ==8, by (group) /*Positive Muslim (Real) or Negative Musl (Real)*/
	ttest PP_limitallimm, by (positive)
	
	ttest PP_limitMuslimm if group ==5 | group ==7, by (group) /*Positive MAM (Real) or Negative MAM (Real)*/
	ttest PP_limitMuslimm if group ==6 | group ==8, by (group) /*Positive Muslim (Real) or Negative Musl (Real)*/
	ttest PP_limitMuslimm, by (positive)
	
	ttest PP_limitMAMreenter if group ==5 | group ==7, by (group) /*Positive MAM (Real) or Negative MAM (Real)*/
	ttest PP_limitMAMreenter if group ==6 | group ==8, by (group) /*Positive Muslim (Real) or Negative Musl (Real)*/
	ttest PP_limitMAMreenter, by (positive)
		
	
******************
**** TABLE G6 ****
******************
	
	use "exp1_exp2.dta", clear

	drop if group ==5| group ==6| group ==7| group ==8

	*Positive MAM (Man) == GROUP == 1
		
		sum age if group ==1
		sum female if group ==1
		sum dem if group ==1
		sum rep if group ==1
		sum independent if group ==1
		sum educ if group ==1
		sum income if group ==1
		sum Premrr if group ==1	
		sum Postmrr if group ==1
		
	*Positive Muslim (Man) == GROUP == 2
		
		sum age if group ==2
		sum female if group ==2
		sum dem if group ==2
		sum rep if group ==2
		sum independent if group ==2
		sum educ if group ==2
		sum income if group ==2
		sum Premrr if group ==2	
		sum Postmrr if group ==2	
		
	*Negative MAM (Man) == GROUP == 3
		
		sum age if group ==3
		sum female if group ==3
		sum dem if group ==3
		sum rep if group ==3
		sum independent if group ==3
		sum educ if group ==3
		sum income if group ==3
		sum Premrr if group ==3	
		sum Postmrr if group ==3	
		
	*Negative Musl (Man) == GROUP == 4
		
		sum age if group ==4
		sum female if group ==4
		sum dem if group ==4
		sum rep if group ==4
		sum independent if group ==4
		sum educ if group ==4
		sum income if group ==4
		sum Premrr if group ==4
		sum Postmrr if group ==4				


******************
**** TABLE G7 ****
******************

	use "exp3.dta", clear

	*Positive MAM (Treatment 1) (fl_32_do= T1-posMAM)
		preserve
		keep if fl_32_do== "T1-posMAM"
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore

	*Alt Positive MAM (Treatment 2) (fl_32_do= T1a-posMAM2)
		preserve
		keep if fl_32_do== "T1a-posMAM2"
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Positive Muslim (Treatment 3) (fl_32_do= T3-posMuslim)
		preserve
		keep if fl_32_do== "T3-posMuslim"
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Negative MAM (Treatment 4) (fl_32_do=  T2-negMAM)
		preserve
		keep if fl_32_do == "T2-negMAM" 
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Negative Muslim (Treatment 5) (fl_32_do=  T4-negMuslim)
		preserve
		keep if fl_32_do== "T4-negMuslim" 
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Positive Latino (Treatment 6) (fl_32_do= T5-posLatino)
		preserve
		keep if fl_32_do== "T5-posLatino" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Positive Immigrant (Treatment 7) (fl_32_do= T7-posimmigrant)
		preserve
		keep if fl_32_do== "T7-posimmigrant" 
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Negative Latino (Treatment 8) (fl_32_do= T6-negLatino)
		preserve
		keep if fl_32_do== "T6-negLatino" 
			
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


	*Negative Immigrant (Treatment 9) (fl_32_do= T8-negimmigrant)
		preserve
		keep if fl_32_do== "T8-negimmigrant"
				
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore

		
	*Control (Treatment 10) (fl_32_do= T9-control)
		preserve
		keep if fl_32_do== "T9-control" 

		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Premrr 
		sum Postmrr 

		restore


******************
**** TABLE G8 ****
******************

	use "exp4.dta", clear

	*Positive MAM (Treatment 1) (fl_21_do= T1-MAMpos-Nazita)
		preserve
		keep if fl_21_do== "T1-MAMpos-Nazita"
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Alt Positive MAM (Treatment 2) (fl_21_do= T2-MAMposalt-Nazita)
		preserve
		keep if fl_21_do== "T2-MAMposalt-Nazita"
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Positive Muslim (Treatment 3) (fl_21_do= T4-Muslimpos-Nazita)
		preserve
		keep if fl_21_do== "T4-Muslimpos-Nazita"
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Negative MAM (Treatment 4) (fl_21_do=  T3-MAMneg-Nazita)
		preserve
		keep if fl_21_do == "T3-MAMneg-Nazita" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Negative Muslim (Treatment 5) (fl_21_do=  T5-Muslimneg-Nazita)
		preserve
		keep if fl_21_do== "T5-Muslimneg-Nazita" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Positive Latino (Treatment 6) (fl_21_do= T8-Latinopos-Nazita)
		preserve
		keep if fl_21_do== "T8-Latinopos-Nazita" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Positive Immigrant (Treatment 7) (fl_21_do= T6-Immpos-Nazita)
		preserve
		keep if fl_21_do== "T6-Immpos-Nazita" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Negative Latino (Treatment 8) (fl_21_do= T9-Latinoneg-Nazita)
		preserve
		keep if fl_21_do== "T9-Latinoneg-Nazita" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore


	*Negative Immigrant (Treatment 9) (fl_21_do= T7-Immneg-Nazita)
		preserve
		keep if fl_21_do== "T7-Immneg-Nazita"
		 		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore

	*Control (Treatment 10) (fl_21_do= T10-control-Nazita)
		preserve
		keep if fl_21_do== "T10-control-Nazita" 
		
		sum age 
		sum female 
		sum dem 
		sum rep 
		sum independent 
		sum educ 
		sum income 
		sum Postmrr 

		restore




**********************
**** TABLE G9-G34 ****
**********************

*See these tables in the appendix for treatment language across the four experiments*




******************
**** TABLE H1 ****
******************


*Validate the MAR measure
	*1) factor analysis
		
	*Experiments 1 & 2
		use "exp1_exp2.dta", clear
	
		*MAR Pre
			preserve
			drop pmrr1 pmrr2 pmrr3 pmrr4 pmrr5 pmrr6 pmrr7 pmrr8 pmrr9
			alpha mrr1-mrr9, item
			factor mrr1 -mrr9, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Premrr -> mrr1-mrr9), standardized
			estat gof, stats(all)
			restore
			
		*MAR Post
			preserve
			drop mrr1 mrr2 mrr3 mrr4 mrr5 mrr6 mrr7 mrr8 mrr9
			alpha pmrr1-pmrr9, item
			factor pmrr1 -pmrr9, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Postmrr -> pmrr1-pmrr9), standardized
			estat gof, stats(all)
			restore
			
			
		*ALT MAR Pre
			preserve
			drop pmrr1 pmrr2 pmrr3 pmrr4 pmrr5 pmrr6 pmrr7 pmrr8 pmrr9 ///
			mrr2 mrr3 mrr5 mrr8 mrr9
			alpha mrr1 mrr4 mrr6 mrr7, item
			factor mrr1 mrr4 mrr6 mrr7, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Premrr_alt -> mrr1 mrr4 mrr6 mrr7), standardized
			estat gof, stats(all)
			restore
			
		*ALT MAR Post
			preserve
			drop mrr1 mrr2 mrr3 mrr4 mrr5 mrr6 mrr7 mrr8 mrr9 ///
			pmrr2 pmrr3 pmrr5 pmrr8 pmrr9	
			alpha pmrr1 pmrr4 pmrr6 pmrr7, item
			factor pmrr1 pmrr4 pmrr6 pmrr7, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Postmrr_alt -> pmrr1 pmrr4 pmrr6 pmrr7), standardized
			estat gof, stats(all)
			restore
			
		
	
	*Experiment 3
		use "exp3.dta", clear

		*MAR Pre
			preserve
			drop pmrr1 pmrr2 pmrr3 pmrr4 pmrr5 pmrr6 pmrr7 pmrr8 pmrr9 
			factor mrr1 -mrr9, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Premrr -> mrr1-mrr9), standardized
			estat gof, stats(all)
			alpha mrr1-mrr9, item
			restore
			
		*MAR Post
			preserve
			drop mrr1 mrr2 mrr3 mrr4 mrr5 mrr6 mrr7 mrr8 mrr9 
			factor pmrr1 -pmrr9, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Postmrr -> pmrr1-pmrr9), standardized
			estat gof, stats(all)
			alpha pmrr1-pmrr9, item
			restore
			
		*ALT MAR Pre
			preserve
			drop pmrr1 pmrr2 pmrr3 pmrr4 pmrr5 pmrr6 pmrr7 pmrr8 pmrr9 ///
			mrr2 mrr3 mrr5 mrr8 mrr9
			factor mrr1 mrr4 mrr6 mrr7, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Premrr_alt -> mrr1 mrr4 mrr6 mrr7), standardized
			estat gof, stats(all)
			alpha mrr1 mrr4 mrr6 mrr7, item
			restore
			
		*ALT MAR Post
			preserve
			drop mrr1 mrr2 mrr3 mrr4 mrr5 mrr6 mrr7 mrr8 mrr9 ///
			pmrr2 pmrr3 pmrr5 pmrr8 pmrr9	
			factor pmrr1 pmrr4 pmrr6 pmrr7, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Postmrr_alt -> pmrr1 pmrr4 pmrr6 pmrr7), standardized
			estat gof, stats(all)
			alpha pmrr1 pmrr4 pmrr6 pmrr7, item
			restore
			
			
	**Experiment 4
		use "exp4.dta", clear

		*MAR Post
			preserve
			factor pmrr1 -pmrr9, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Postmrr -> pmrr1-pmrr9), standardized
			estat gof, stats(all)
			alpha pmrr1-pmrr9, item
			restore
			
		
		*ALT MAR Post
			preserve
			drop pmrr2 pmrr3 pmrr5 pmrr8 pmrr9	
			factor pmrr1 pmrr4 pmrr6 pmrr7, ipf factor(2)
			screeplot
			rotate, varimax horst
			sem(Postmrr_alt -> pmrr1 pmrr4 pmrr6 pmrr7), standardized
			estat gof, stats(all)
			alpha pmrr1 pmrr4 pmrr6 pmrr7, item
			restore

	
******************
**** TABLE H2 ****
******************

	eststo clear
	
	preserve /*Exp1*/
	use "exp1_exp2.dta", clear 
	drop if group ==5| group ==6| group ==7| group ==8
	eststo: reg Postmrr age income educ female democrat independent 
	restore

	preserve /*Exp2*/
	use "exp1_exp2.dta", clear 
	drop if group ==1| group ==2| group ==3| group ==4
	eststo: reg Postmrr age income educ female democrat independent 
	restore

	preserve /*Exp3*/
	use "exp3.dta", clear 
	eststo: reg Postmrr age income educ female democrat independent 
	restore

	esttab, se r2
	esttab using tableH2.tex, se r2 replace	





******************
**** TABLE H3 ****
******************

	*Experiment 1
		use "exp1_exp2.dta" , clear
		drop if group ==1| group ==2| group ==3| group ==4

		sum mrr1
		sum pmrr1

		sum mrr2
		sum pmrr2

		sum mrr3
		sum pmrr3

		sum mrr4
		sum pmrr4

		sum mrr5
		sum pmrr5

		sum mrr6
		sum pmrr6

		sum mrr7
		sum pmrr7

		sum mrr8
		sum pmrr8

		sum mrr9
		sum pmrr9


	*Experiment2
		use "exp1_exp2.dta", clear
		drop if group ==5| group ==6| group ==7| group ==8

		sum mrr1
		sum pmrr1

		sum mrr2
		sum pmrr2

		sum mrr3
		sum pmrr3

		sum mrr4
		sum pmrr4

		sum mrr5
		sum pmrr5

		sum mrr6
		sum pmrr6

		sum mrr7
		sum pmrr7

		sum mrr8
		sum pmrr8

		sum mrr9
		sum pmrr9


	*Experiment3
		use "exp3.dta", clear
		keep if muslimexperiment ==1
		drop if fl_32_do== "T1a-posMAM2"

		sum mrr1
		sum pmrr1

		sum mrr2
		sum pmrr2

		sum mrr3
		sum pmrr3

		sum mrr4
		sum pmrr4

		sum mrr5
		sum pmrr5

		sum mrr6
		sum pmrr6

		sum mrr7
		sum pmrr7

		sum mrr8
		sum pmrr8

		sum mrr9
		sum pmrr9



	*Experiment4
		use "exp4.dta", clear
		keep if muslimexperiment ==1
		drop if fl_21_do== "T2-MAMposalt-Nazita"

		sum pmrr1

		sum pmrr2

		sum pmrr3

		sum pmrr4

		sum pmrr5

		sum pmrr6

		sum pmrr7

		sum pmrr8

		sum pmrr9



		
*******************
**** TABLE H4  ****
*******************

	*Exp 1
		use "exp1_exp2.dta", clear
				
		ttest Premrr == Postmrr if group == 5  /*Positive MAM (Real)*/
		ttest Premrr == Postmrr if group == 6  /*Positive Muslim (Real)*/
		ttest Premrr == Postmrr if group == 5|group == 6  /*agg*/	

		ttest Premrr == Postmrr if group == 7  /*Negative MAM (Real) */
		ttest Premrr == Postmrr if group == 8  /*Negative Musl (Real)*/	
		ttest Premrr == Postmrr if group == 7|group == 8  /*agg*/	
		
			
	*Exp2
		use "exp1_exp2.dta", clear
		
		ttest Premrr3 == Postmrr3 if group == 1  /*Positive MAM (Man)*/
		ttest Premrr3 == Postmrr3 if group == 2  /*Positive Musl (Man)*/	
		ttest Premrr3 == Postmrr3 if group == 1| group == 2  /*agg*/	

		ttest Premrr3 == Postmrr3 if group == 3  /*Negative MAM (Man)*/
		ttest Premrr3 == Postmrr3 if group == 4  /*Negative Musl (Man)*/	
		ttest Premrr3 == Postmrr3 if group == 3|  group == 4  /*agg*/	
		
	
		
*******************
**** TABLE H5  ****
*******************
	
	use "exp1_exp2.dta", clear /*Looking at experiment 2*/
	
	ttest Postmrr3 if group == 1 | group ==3, by (group)  /*Positive versus Negative MAM (Man)*/
	ttest Postmrr3 if group == 2 | group ==4, by (group) /*Positive versus Negative Muslim (Man)*/
	ttest Postmrr3 if group == 1| group == 2| group == 3| group ==4, by(positive)
	

		
******************
**** TABLE H6 ****
******************

	use "exp3.dta", clear

	ttest Premrr == Postmrr if fl_32_do == "T1-posMAM"
	ttest Premrr == Postmrr if fl_32_do == "T1a-posMAM2"
	ttest Premrr == Postmrr if fl_32_do == "T3-posMuslim"

	ttest Premrr == Postmrr if fl_32_do ==  "T2-negMAM"
	ttest Premrr == Postmrr if fl_32_do == "T4-negMuslim" 

	ttest Premrr == Postmrr if fl_32_do == "T9-control" 


******************
**** TABLE H7 ****
******************

	use "exp3.dta", clear

	ttest Postmrr if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)


******************
**** TABLE H8 ****
******************

	use "exp3.dta", clear

	ttest Premrr3 == Postmrr3 if fl_32_do == "T1-posMAM"
	ttest Premrr3 == Postmrr3 if fl_32_do == "T1a-posMAM2"
	ttest Premrr3 == Postmrr3 if fl_32_do == "T3-posMuslim"
	ttest Premrr3 == Postmrr3 if muslimexperiment ==1 & positivetreatment ==1

	ttest Premrr3 == Postmrr3 if fl_32_do == "T2-negMAM"
	ttest Premrr3 == Postmrr3 if fl_32_do == "T4-negMuslim" 
	ttest Premrr3 == Postmrr3 if muslimexperiment ==1 & positivetreatment ==0

	ttest Premrr3 == Postmrr3 if fl_32_do == "T9-control" 


******************
**** TABLE H9 ****
******************

	use "exp3.dta", clear

	ttest Postmrr3 if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr3 if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr3 if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)
	ttest Postmrr3 if muslimexperiment == 1, by (negativetreatment)

	
	
*******************
**** TABLE H10 ****
*******************

	use "exp3.dta", clear

	ttest feeltherm_MAM_pre == feeltherm_MAM_post if  fl_32_do == "T1-posMAM"
	ttest feeltherm_MAM_pre == feeltherm_MAM_post if  fl_32_do == "T1a-posMAM2" 
	ttest feeltherm_MAM_pre == feeltherm_MAM_post if  fl_32_do == "T3-posMuslim"
	ttest feeltherm_MAM_pre == feeltherm_MAM_post if muslimexperiment ==1 & positivetreatment ==1
	
	ttest feeltherm_MAM_pre == feeltherm_MAM_post if  fl_32_do == "T2-negMAM"
	ttest feeltherm_MAM_pre == feeltherm_MAM_post if  fl_32_do == "T4-negMuslim" 
	ttest feeltherm_MAM_pre == feeltherm_MAM_post if muslimexperiment ==1 & positivetreatment ==0

	ttest feeltherm_MAM_pre == feeltherm_MAM_post if control ==1

	
*******************
**** TABLE H11 ****
*******************

	use "exp3.dta", clear

	ttest feeltherm_MAM_post if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest feeltherm_MAM_post if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest feeltherm_MAM_post if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)
	ttest feeltherm_MAM_post if muslimexperiment == 1, by (negativetreatment)

	

******************
**** TABLE H12 ***
******************

	use "exp3.dta", clear

	ttest Postmrr if fl_32_do == "T1-posMAM"| fl_32_do == "T9-control", by (fl_32_do)
	ttest Postmrr if fl_32_do == "T1a-posMAM2"| fl_32_do == "T9-control", by (fl_32_do)
	ttest Postmrr if fl_32_do == "T3-posMuslim"| fl_32_do == "T9-control", by (fl_32_do)
	ttest Postmrr if fl_32_do == "T2-negMAM"| fl_32_do == "T9-control", by (fl_32_do)
	ttest Postmrr if fl_32_do == "T4-negMuslim"| fl_32_do == "T9-control", by (fl_32_do)





******************
**** TABLE H13 ****
******************

	use "exp3.dta", clear

	ttest Premrr == Postmrr if fl_32_do == "T5-posLatino"
	ttest Premrr == Postmrr if fl_32_do == "T7-posimmigrant"
	ttest Premrr == Postmrr if fl_32_do == "T6-negLatino"
	ttest Premrr == Postmrr if fl_32_do ==  "T8-negimmigrant"



*******************
**** TABLE H14 ****
*******************

	use "exp3.dta", clear

	ttest Postmrr if fl_32_do == "T5-posLatino"| fl_32_do== "T6-negLatino", by(fl_32_do)
	ttest Postmrr if fl_32_do == "T7-posimmigrant"| fl_32_do== "T8-negimmigrant", by(fl_32_do)

	

*******************
**** TABLE H15 ****
*******************

	use "exp3.dta", clear

	ttest PP_limitallimm if fl_32_do == "T5-posLatino"| fl_32_do == "T6-negLatino", by (fl_32_do)
	ttest PP_limitallimm if fl_32_do == "T7-posimmigrant"| fl_32_do == "T8-negimmigrant", by (fl_32_do)

	ttest PP_limitMuslimm if fl_32_do == "T5-posLatino"| fl_32_do == "T6-negLatino", by (fl_32_do)
	ttest PP_limitMuslimm if fl_32_do == "T7-posimmigrant"| fl_32_do == "T8-negimmigrant", by (fl_32_do)

	ttest PP_limitMAMreenter if fl_32_do == "T5-posLatino"| fl_32_do == "T6-negLatino", by (fl_32_do)
	ttest PP_limitMAMreenter if fl_32_do == "T7-posimmigrant"| fl_32_do == "T8-negimmigrant", by (fl_32_do)


*****************
**** TABLE H16 ** 
*****************

	use "exp3.dta", clear

	ttest feeltherm_latino_pre == feeltherm_latino_post if fl_32_do == "T5-posLatino"
	ttest feeltherm_illimm_pre == feeltherm_illimm_post if fl_32_do == "T7-posimmigrant"
	ttest feeltherm_latino_pre == feeltherm_latino_post if fl_32_do == "T6-negLatino"
	ttest feeltherm_illimm_pre == feeltherm_illimm_post if fl_32_do ==  "T8-negimmigrant"
	
	
*******************
**** TABLE H17 ****
*******************

	use "exp3.dta", clear

	ttest cces if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest cces if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest cces if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)

	ttest cces if fl_32_do == "T5-posLatino"| fl_32_do == "T6-negLatino", by (fl_32_do)
	ttest cces if fl_32_do == "T7-posimmigrant"| fl_32_do == "T8-negimmigrant", by (fl_32_do)

	
*******************
**** TABLE H18 ****
*******************

	use "exp3.dta", clear

	ttest PP_limitallimm if fl_32_do =="T1-posMAM" | fl_32_do == "T9-control", by(fl_32_do)
	ttest PP_limitMuslimm if fl_32_do =="T1-posMAM" | fl_32_do == "T9-control", by(fl_32_do)
	ttest PP_limitMAMreenter if fl_32_do =="T1-posMAM" | fl_32_do == "T9-control", by(fl_32_do)

	ttest PP_limitallimm if fl_32_do =="T1a-posMAM2" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMuslimm if fl_32_do =="T1a-posMAM2" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMAMreenter if fl_32_do =="T1a-posMAM2" | fl_32_do =="T9-control", by(fl_32_do)

	ttest PP_limitallimm if fl_32_do =="T3-posMuslim" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMuslimm if fl_32_do =="T3-posMuslim" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMAMreenter if fl_32_do =="T3-posMuslim" | fl_32_do =="T9-control", by(fl_32_do)

	ttest PP_limitallimm if fl_32_do =="T2-negMAM" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMuslimm if fl_32_do =="T2-negMAM" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMAMreenter if fl_32_do =="T2-negMAM" | fl_32_do =="T9-control", by(fl_32_do)

	ttest PP_limitallimm if fl_32_do =="T4-negMuslim" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMuslimm if fl_32_do =="T4-negMuslim" | fl_32_do =="T9-control", by(fl_32_do)
	ttest PP_limitMAMreenter if fl_32_do =="T4-negMuslim" | fl_32_do =="T9-control", by(fl_32_do)

	

*******************
**** TABLE H19 ****
*******************

	use "exp3.dta", clear

	preserve
	keep if republican ==1
	ttest Postmrr if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	preserve
	keep if democrat ==1 
	ttest Postmrr if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	preserve
	keep if independent ==1
	ttest Postmrr if fl_32_do =="T1-posMAM" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T1a-posMAM2" | fl_32_do =="T2-negMAM", by(fl_32_do)
	ttest Postmrr if fl_32_do =="T3-posMuslim" | fl_32_do =="T4-negMuslim", by(fl_32_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore


*******************
**** TABLE H20 ****
*******************
		
		
	use "exp4.dta", clear

	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)

	preserve
	keep if manipulationcheck_pass_MAM==1 | manipulationcheck_pass_Muslim==1
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore


	
*******************
**** TABLE H21 ****
*******************
		
	use "exp4.dta", clear

	ttest Postmrr3 if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr3 if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr3 if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr3 if muslimexperiment == 1, by (negativetreatment)


	preserve
	keep if manipulationcheck_pass_MAM==1 | manipulationcheck_pass_Muslim==1
	ttest Postmrr3 if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr3 if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr3 if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr3 if muslimexperiment == 1, by (negativetreatment)
	restore
	

	
*******************
**** TABLE H22 ****
*******************
		
	use "exp4.dta", clear

	ttest feeltherm_MAM_post if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest feeltherm_MAM_post if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest feeltherm_MAM_post if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest feeltherm_MAM_post if muslimexperiment == 1, by (negativetreatment)

	preserve
	keep if manipulationcheck_pass_MAM==1 | manipulationcheck_pass_Muslim==1
	ttest feeltherm_MAM_post if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest feeltherm_MAM_post if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest feeltherm_MAM_post if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest feeltherm_MAM_post if muslimexperiment == 1, by (negativetreatment)
	restore

	
	
*******************
**** TABLE H23 ****
*******************
				
	use "exp4.dta", clear

	ttest Postmrr if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by(fl_21_do)

	preserve
	keep if manipulationcheck_pass_latino==1 | manipulationcheck_pass_immigrant==1 
	ttest Postmrr if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by(fl_21_do)
	restore

	
	
*******************
**** TABLE H24 ****
*******************
	
	use "exp4.dta", clear

	ttest PP_limitallimm if fl_21_do == "T8-Latinopos-Nazita"| fl_21_do == "T9-Latinoneg-Nazita", by (fl_21_do)
	ttest PP_limitallimm if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by (fl_21_do)
	ttest PP_limitMuslimm if fl_21_do == "T8-Latinopos-Nazita"| fl_21_do == "T9-Latinoneg-Nazita", by (fl_21_do)
	ttest PP_limitMuslimm if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by (fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita", by (fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by (fl_21_do)

	preserve
	keep if manipulationcheck_pass_latino==1 | manipulationcheck_pass_immigrant==1 
	ttest PP_limitallimm if fl_21_do == "T8-Latinopos-Nazita"| fl_21_do == "T9-Latinoneg-Nazita", by (fl_21_do)
	ttest PP_limitallimm if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by (fl_21_do)
	ttest PP_limitMuslimm if fl_21_do == "T8-Latinopos-Nazita"| fl_21_do == "T9-Latinoneg-Nazita", by (fl_21_do)
	ttest PP_limitMuslimm if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by (fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita", by (fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by (fl_21_do)
	restore
	
	
*******************
**** TABLE H25 **** 
*******************
		
	use "exp4.dta", clear

	ttest feeltherm_latino_post if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita", by(fl_21_do)
	ttest feeltherm_imm_post if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by(fl_21_do)

	preserve
	keep if manipulationcheck_pass_latino==1 | manipulationcheck_pass_immigrant==1 
	ttest feeltherm_latino_post if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita", by(fl_21_do)
	ttest feeltherm_imm_post if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita", by(fl_21_do)
	restore

	
	
*******************
**** TABLE H26 ****
*******************
			
	use "exp4.dta", clear
	
	ttest feeltherm_MAM_post if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita" ==1 , by (fl_21_do)
	ttest feeltherm_MAM_post if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita" , by (fl_21_do)
	
	preserve
	keep if manipulationcheck_pass_latino==1 | manipulationcheck_pass_immigrant==1 
	ttest feeltherm_MAM_post if fl_21_do == "T8-Latinopos-Nazita" | fl_21_do == "T9-Latinoneg-Nazita" ==1 , by (fl_21_do)
	ttest feeltherm_MAM_post if fl_21_do == "T6-Immpos-Nazita" | fl_21_do == "T7-Immneg-Nazita" , by (fl_21_do)
	restore	


*******************
**** TABLE H27 ****
*******************
	
	use "exp4.dta", clear

	ttest PP_limitallimm if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do == "T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do == "T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do == "T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T3-MAMneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T3-MAMneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T3-MAMneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T5-Muslimneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T5-Muslimneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T5-Muslimneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)



	preserve
	keep if manipulationcheck_pass_MAM==1 | manipulationcheck_pass_Muslim==1 | fl_21_do == "T10-control-Nazita"
	ttest PP_limitallimm if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do == "T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do == "T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do == "T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T3-MAMneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T3-MAMneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T3-MAMneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)

	ttest PP_limitallimm if fl_21_do =="T5-Muslimneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMuslimm if fl_21_do =="T5-Muslimneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	ttest PP_limitMAMreenter if fl_21_do =="T5-Muslimneg-Nazita" | fl_21_do =="T10-control-Nazita", by(fl_21_do)
	restore


	
	
*******************
**** TABLE H28 ****
*******************
		
	use "exp1_exp2.dta", clear

	drop if group ==5| group ==6| group ==7| group ==8

	*EXPERIMENT 1 = MANIPULATED
	
		*Positive MAM (Man) == GROUP == 1
		*Positive Muslim (Man) == GROUP == 2
		*Negative MAM (Man) == GROUP == 3
		*Negative Musl (Man) == GROUP == 4
	
	preserve
	keep if republican == 1 
	ttest Premrr == Postmrr if group ==1
	ttest Premrr == Postmrr if group ==2
	ttest Premrr == Postmrr if group ==3
	ttest Premrr == Postmrr if group ==4
	restore

	preserve
	keep if democrat == 1 
	ttest Premrr == Postmrr if group ==1
	ttest Premrr == Postmrr if group ==2
	ttest Premrr == Postmrr if group ==3
	ttest Premrr == Postmrr if group ==4
	restore

	preserve
	keep if independent == 1 | otherparty == 1
	ttest Premrr == Postmrr if group ==1
	ttest Premrr == Postmrr if group ==2
	ttest Premrr == Postmrr if group ==3
	ttest Premrr == Postmrr if group ==4
	restore	
		

		
		
*******************
**** TABLE H29 ****
*******************
	use "exp1_exp2.dta", clear

	drop if group ==5| group ==6| group ==7| group ==8
	
	preserve
	keep if republican == 1 
	ttest Postmrr if group ==1 | group ==3, by(group)
	ttest Postmrr if group == 2 | group ==4, by(group)
	ttest Postmrr if manipulated == 1, by (positive)
	restore
	
	preserve
	keep if democrat == 1 
	ttest Postmrr if group ==1 | group ==3, by(group)
	ttest Postmrr if group == 2 | group ==4, by(group)
	ttest Postmrr if manipulated == 1, by (positive)
	restore

	preserve
	keep if independent == 1 | otherparty == 1
	ttest Postmrr if group ==1 | group ==3, by(group)
	ttest Postmrr if group == 2 | group ==4, by(group)
	ttest Postmrr if manipulated == 1, by (positive)
	restore


	
	
*******************
**** TABLE H30 ****
*******************
	
	use "exp3.dta", clear

	preserve
	keep if republican ==1
	ttest Premrr == Postmrr if fl_32_do =="T1-posMAM" 
	ttest Premrr == Postmrr if fl_32_do =="T1a-posMAM2" 
	ttest Premrr == Postmrr if fl_32_do =="T3-posMuslim" 
	ttest Premrr == Postmrr if fl_32_do =="T2-negMAM"
	ttest Premrr == Postmrr if fl_32_do =="T4-negMuslim"
	restore

	preserve
	keep if democrat ==1 
	ttest Premrr == Postmrr if fl_32_do =="T1-posMAM" 
	ttest Premrr == Postmrr if fl_32_do =="T1a-posMAM2" 
	ttest Premrr == Postmrr if fl_32_do =="T3-posMuslim" 
	ttest Premrr == Postmrr if fl_32_do =="T2-negMAM"
	ttest Premrr == Postmrr if fl_32_do =="T4-negMuslim"
	restore

	preserve
	keep if independent ==1
	ttest Premrr == Postmrr if fl_32_do =="T1-posMAM" 
	ttest Premrr == Postmrr if fl_32_do =="T1a-posMAM2" 
	ttest Premrr == Postmrr if fl_32_do =="T3-posMuslim" 
	ttest Premrr == Postmrr if fl_32_do =="T2-negMAM"
	ttest Premrr == Postmrr if fl_32_do =="T4-negMuslim"
	restore
	
	
		
*******************
**** TABLE H31 ****
*******************
		
	use "exp4.dta", clear

	drop if muslimexperiment!=1
	preserve
	keep if republican ==1
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	preserve
	keep if democrat ==1 
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	preserve
	keep if independent ==1
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	
	keep if manipulationcheck_pass_MAM==1 | manipulationcheck_pass_Muslim==1 
	
	preserve
	keep if republican ==1
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	preserve
	keep if democrat ==1 
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

	preserve
	keep if independent ==1
	ttest Postmrr if fl_21_do =="T1-MAMpos-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T2-MAMposalt-Nazita" | fl_21_do =="T3-MAMneg-Nazita", by(fl_21_do)
	ttest Postmrr if fl_21_do =="T4-Muslimpos-Nazita" | fl_21_do =="T5-Muslimneg-Nazita", by(fl_21_do)
	ttest Postmrr if muslimexperiment == 1, by (negativetreatment)
	restore

		
	
capture log close
